﻿using System;
using System.Collections.Generic;

namespace ParserGenerator.Collections
{
    public static class HashSet
    {
        public static HashSet<T> GetEmpty<T>()
        {
            return new HashSet<T>();
        }

        public static HashSet<T> New<T>(IEnumerable<T> collection)
        {
            if (collection == null)
                throw new ArgumentNullException(nameof(collection));
            return new HashSet<T>(collection);
        }

        public static HashSet<T> Create<T>(params T[] items)
        {
            if (items == null)
                throw new ArgumentNullException(nameof(items));
            return New(items);
        }
    }
}
